Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.SLNX format support #10794

Merged
merged 25 commits into from
Oct 17, 2024
Merged

.SLNX format support #10794

merged 25 commits into from
Oct 17, 2024

Conversation

surayya-MS
Copy link
Member

@surayya-MS surayya-MS commented Oct 10, 2024

Fixes #10266

Context

We currently use our own parser SolutionFile.Parse() to parse .sln files in order to build them.
In this PR I intergrate the new package Microsoft.VisualStudio.SolutionPersistence to parse the new format .slnx files.

Key differences in the SolutionFile from the package's SolutionModel:

  1. ProjectsInOrder and ProjectsByGuid no loner include solution folders because they are saved separately (in the package SolutionModel.SolutionProjects and SolutionModel.SolutionFolders)
  2. SolutionConfigurations are not available in the SolutionModel, instead there are BuildTypes and Platforms. Since SolutionConfigurations are used in SolutionGenerator a lot, I needed SolutionConfigurations represented accurately. Combination of SoutionModel's BuildTypes and Platforms might be redundant, so I collect Solution configurations from each project's configurations.

Changes Made

Testing

  1. Added tests in SolutionFile_Tests that cover .slnx cases
  2. Added SolutionFile_NewParser_Tests with only one test for parse website properties as it was not possible to do that in SolutionFile_Tests because AspNetConfigurations is internal.
  3. Tested manually as well.

Notes

Copy link

@ssg ssg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I propose explicit matching of filename extensions.

src/MSBuild/XMake.cs Show resolved Hide resolved
@kasperk81
Copy link
Contributor

@rainersigwald
Copy link
Member

@kasperk81 we're going to use that deserializer in a follow-up PR. We're trying to make this PR the "minimum risk for potential backport to 9.0.1xx SDK" change, so keeping the existing sln behavior.

Copy link
Member

@JanKrivanek JanKrivanek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All looks as expected.

But I did just a quick pass - will go more in depth tomorrow

src/Build/Construction/Solution/SolutionFile.cs Outdated Show resolved Hide resolved
eng/Versions.props Outdated Show resolved Hide resolved
src/Build/Microsoft.Build.csproj Outdated Show resolved Hide resolved
eng/Versions.props Outdated Show resolved Hide resolved
src/MSBuild.UnitTests/XMake_Tests.cs Outdated Show resolved Hide resolved
src/Build.UnitTests/Construction/SolutionFilter_Tests.cs Outdated Show resolved Hide resolved
src/Build.OM.UnitTests/Construction/SolutionFile_Tests.cs Outdated Show resolved Hide resolved
src/Build/Construction/Solution/SolutionFile.cs Outdated Show resolved Hide resolved
src/Build/Construction/Solution/SolutionFile.cs Outdated Show resolved Hide resolved
Copy link
Member

@JanKrivanek JanKrivanek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

src/Build/Construction/Solution/SolutionFile.cs Outdated Show resolved Hide resolved
@kasperk81
Copy link
Contributor

@surayya-MS should fix tests for unix handling be done in the product or does it produce expected style understood by consumer code?

@surayya-MS
Copy link
Member Author

@surayya-MS should fix tests for unix handling be done in the product or does it produce expected style understood by consumer code?

It's just / or \ difference.

@kasperk81
Copy link
Contributor

Opened dotnet/source-build-externals#392 for source build error (should be the same version as the package)

@surayya-MS surayya-MS enabled auto-merge (squash) October 16, 2024 14:42
@surayya-MS surayya-MS disabled auto-merge October 16, 2024 15:01
@surayya-MS surayya-MS enabled auto-merge (squash) October 16, 2024 15:27
@surayya-MS surayya-MS disabled auto-merge October 16, 2024 15:28
@surayya-MS surayya-MS merged commit adb4394 into dotnet:main Oct 17, 2024
10 checks passed
@surayya-MS surayya-MS deleted the slnx-support-first branch October 17, 2024 06:12
@surayya-MS
Copy link
Member Author

follow-up PR to replace existing .sln parser with Microsoft.VisualStudio.SolutionPersistence #10836

@jrdodds
Copy link
Contributor

jrdodds commented Nov 8, 2024

This PR also fixes Bug #9587

@softlion
Copy link

what dotnet version will this be in ?
9.0.100 ?

@kasperk81
Copy link
Contributor

9.0.200 see dotnet/sdk#40913

@chucker
Copy link

chucker commented Dec 11, 2024

what dotnet version will this be in ? 9.0.100 ?

9.0.100 is already out; SLNX support is slated for 9.0.200.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request]: Support building the new Visual Studio solution file format (.slnx)
10 participants